﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LoginWeixin.aspx.cs" Inherits="ZLCMS.Web.Wap.Member.LoginWeixin" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>微信登录</title>
    <script src="/Wap/lib/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="/Wap/lib/jquery/jquery.json-2.2.min.js" type="text/javascript"></script>
    <script src="/wap/lib/jquery/jquery.cookie.js" type="text/javascript"></script>
    <script src="/Wap/lib/command/Command.js" type="text/javascript"></script>
</head>
<body>
<div>
      <div style="text-align:center;"><img style="max-width: 100%;" src="<%=QrPath %>"/></div>
      <p style="text-align:center;">使用手机微信扫描二维码，实现登录</p>
</div>


 <script type="text/javascript">
    function checkQRScan() {
        var param = { CheckString: '<%=CheckString %>' };
        $(document).executeCommand({

            successCallBack: function (result, totalcnt) {
                if (result.Status == '1') {
                    location.href = 'LoginSuccess.aspx?token=' + result.MemberAccount + '&goto=<%=Server.UrlEncode(Request["goto"]) %>&origin=<%= Server.UrlEncode(Request["origin"])%>';    
                }
                else {
                    //每隔两秒查询条码状态
                    setTimeout(function () {
                        checkQRScan();
                    }, 2000);
                }
            },
            errorCallback: function (errorCode, msg) {
                showTips(msg);
            }
        }

    , 'Member.QueryScanStatus', param);
    }

    $(document).ready(function () { checkQRScan(); });
</script>

</body>
</html>